<template>
  <a-layout class="layout">
    <a-layout-header class="header">
      <div class="logo">B海冷链商家管理系统</div>
      <a-menu mode="horizontal" class="menu">
        <a-menu-item key="products">
          <router-link to="/business/myProd">我的商品</router-link>
        </a-menu-item>
        <a-menu-item key="orders">
          <router-link to="/business/orders">订单</router-link>
        </a-menu-item>
        <a-menu-item key="account">
          <router-link to="/business/account">账户</router-link>
        </a-menu-item>
      </a-menu>
    </a-layout-header>
    <a-layout-content class="content">
      <router-view />
    </a-layout-content>
  </a-layout>
</template>

<script>
import router from '../../router';
import { message } from 'ant-design-vue';

export default {
  name: 'BusLayout',
  data() {
    return {
      current: 'products', // 默认选中的菜单项
    };
  },
  mounted() {
    if(sessionStorage.getItem('userid') === null || sessionStorage.getItem('role') !== 'business') {
      message.info('请登录！');
      router.push({ name: 'Login' });
    }
  },
  methods: {
  },
};
</script>

<style scoped src="../../assets/styles/busLayout.css"></style>